package zhy.test_touch_event;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.MotionEvent;

public class TestTouchEventActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MyLinearLayout group=new MyLinearLayout(this);
        setContentView(group);
        MyTextView view =new MyTextView(this);
        view.setText("aaaaaaaaaaaaaaaaaaaaaaa\r\nbbbbbbbbbbbbbbbbbb");
        view.setBackgroundColor(Color.CYAN);
        group.addView(view);
    }
    
    
    @Override
    public boolean onTouchEvent(MotionEvent ev) {
    	System.out.println("Activity onTouchEvent:"+(ev.getAction()==0?"down":ev.getAction()==1?"up":ev.getAction()==2?"move":"cancel"));
    	return false;
    }
}